package pub

import (
	"encoding/json"
	"fmt"
	MQ "seckill-srv/basic/init"
	"seckill-srv/handler/model"
)

func PublishOrder(order *model.Order) error {
	marshal, _ := json.Marshal(order)
	rabbitmq := MQ.NewRabbitMQSimple("" + "2301a_seckill")
	rabbitmq.PublishSimple(marshal)
	fmt.Println("发送成功")
	return nil
}
